using Microsoft.Xna.Framework;
using SCSEngine.Utils.Entities.Component;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCSEngine.Utils.Entities.Process.Movement
{
    public class AcceleratedMovementProcess : LinearMovementProcess
    {
        private IVector2Component acceleration;

        public AcceleratedMovementProcess(IGameEntity entity)
            : base(entity)
        {
            this.acceleration = entity.GetComponent<IVector2Component>(ComponentKeys.Acceleration);
        }

        public override void Move(GameTime gameTime)
        {
            base.Move(gameTime);

            this.velocity.Value += this.acceleration.Value * (float)gameTime.ElapsedGameTime.TotalSeconds;
        }
    }
}
